#include "currentstatus.h"

CurrentStatus *CurrentStatus::_instance = NULL;

CurrentStatus *CurrentStatus::getInstance()
{
    if(_instance==NULL)
    {
        _instance = new CurrentStatus;
    }
    return _instance;
}

CurrentStatus::CurrentStatus()
{
    _ripping = false;
    _updating = false;
    _watingForReboot = false;
    _currentStatus = CurrentStatus::CURRENT_STATUS_IDLE;
    _progress = 0;
}

bool CurrentStatus::getRipping() const
{
    return _ripping;
}

bool CurrentStatus::getUpdating() const
{
    return _updating;
}
bool CurrentStatus::getWatingForReboot() const
{
    return _watingForReboot;
}
uint CurrentStatus::getProgress()
{
    return _progress;
}

void CurrentStatus::setRipping(const bool& value)
{
    value?this->setCurrentStatus(CURRENT_STATUS_RIPPING):this->setCurrentStatus(CURRENT_STATUS_IDLE);
    _ripping = value;
}

void CurrentStatus::setUpdating(const bool &value)
{
    value?this->setCurrentStatus(CURRENT_STATUS_UPDATING):this->setCurrentStatus(CURRENT_STATUS_IDLE);
    _updating = value;
}
void CurrentStatus::setWatingForReboot(const bool &value)
{
    value?this->setCurrentStatus(CURRENT_STATUS_WAITIN_FOR_REBOOT):this->setCurrentStatus(CURRENT_STATUS_IDLE);
    _watingForReboot = value;
}

CurrentStatus::eCurrentStatus CurrentStatus::getCurrentStatus() const
{
    return _currentStatus;
}
void CurrentStatus::setCurrentStatus(eCurrentStatus value)
{
    _currentStatus = value;
}
void CurrentStatus::setProgress(uint value)
{
    _progress = value;
}
